package com.mybdqn.service;

import com.mybdqn.pojo.RolePermission;
import com.mybdqn.dao.RolePermissionMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* Service Class RolePermission
*
* 2017-12-14
*/

@Service
@Transactional
public class RolePermissionServiceImpl implements RolePermissionService {

    @Resource
    private RolePermissionMapper rolePermissionMapper;

    @Transactional(readOnly = true)
    public RolePermission getRolePermissionById(Integer id)throws Exception{
        return rolePermissionMapper.getRolePermissionById(id);
    }

    @Transactional(readOnly = true)
    public List<RolePermission> getRolePermissionListByMap(Map<String,Object> param)throws Exception {
        return rolePermissionMapper.getRolePermissionListByMap(param);
    }
    
    @Transactional(readOnly = true)
    public Integer getRolePermissionRecCountByMap(Map<String,Object> param)throws Exception {
    	return rolePermissionMapper.getRolePermissionRecordCount(param);
    }
    

    public Integer insertRolePermission(RolePermission rolePermission)throws Exception {
        return rolePermissionMapper.insertRolePermission(rolePermission);
    }

    public Integer updateRolePermission(RolePermission rolePermission)throws Exception {
        return rolePermissionMapper.updateRolePermission(rolePermission);
    }

    public Integer deleteRolePermissionById(Integer id)throws Exception {
        return rolePermissionMapper.deleteRolePermissionById(id);
    }

}